package games;

/**
 * Created by Administrator on 2017/2/7.
 */
import java.awt.*;
import javax.swing.JFrame;

public class JumpChess extends JFrame{
    public JumpChess(){
        setSize(800,800);
        setVisible(true);
        setBackground(Color.pink);
    }
    public void paint(Graphics g){
        g.setColor(Color.gray);
        int x=290;
        int y=140;
        int x1=330;
        for(int row=1;row<13;row++){
            g.drawLine(x,y,x1,y);
            x=x-20;
            x1=x1+20;
            y=y+30;
            System.out.println();
        }
        int x2=110;
        int y2=230;
        int x3=90;
        int y3=260;
        for(int row=1;row<13;row++){
            g.drawLine(x2,y2,x3,y3);
            x2=x2+40;
            x3=x3+20;
            y3=y3+30;
            System.out.println();
        }
        int x4=510;
        int y4=230;
        int x5=530;
        int y5=260;
        for(int row=1;row<13;row++){
            g.drawLine(x4,y4,x5,y5);
            x4=x4-40;
            x5=x5-20;
            y5=y5+30;
            System.out.println();
        }
        int x6=510;
        int y6=470;
        int x7=530;
        int y7=440;
        for(int row=1;row<13;row++){
            g.drawLine(x6,y6,x7,y7);
            x6=x6-40;
            x7=x7-20;
            y7=y7-30;
            System.out.println();
        }
        int x8=110;
        int y8=470;
        int x9=90;
        int y9=440;
        for(int row=1;row<13;row++){
            g.drawLine(x8,y8,x9,y9);
            x8=x8+40;
            x9=x9+20;
            y9=y9-30;
            System.out.println();
        }
        int x10=290;
        int y10=560;
        int x11=330;
        for(int row=1;row<13;row++){
            g.drawLine(x10,y10,x11,y10);
            x10=x10-20;
            x11=x11+20;
            y10=y10-30;
            System.out.println();
        }
        int a=300;
        int b=100;
        for(int row=1;row<10;row++){
            for(int column=1;column<=row;column++){
                if(row<=4){
                    g.setColor(Color.red);
                }
                else{
                    g.setColor(Color.blue);
                }
                g.drawOval(a,b,20,20);
                g.fillOval(a,b,20,20);
                a=a+40;
            }
            a=300-20*row;
            b=b+30;
            System.out.println();
        }
        int a1=300;
        int b1=580;
        for(int row=9;row>1;row--){
            for(int column=9;column>=row;column--){
                if(row>=5){
                    g.setColor(Color.red);
                }
                else{
                    g.setColor(Color.blue);
                }
                g.drawOval(a1,b1,20,20);
                g.fillOval(a1,b1,20,20);
                a1=a1+40;
            }
            a1=300-20*(10-row);
            b1=b1-30;
            System.out.println();
        }
        int a2=120;
        int b2=310;
        for(int row=5;row>1;row--){
            for(int column=5;column>=row;column--){
                g.setColor(Color.yellow);
                g.drawOval(a2,b2,20,20);
                g.fillOval(a2,b2,20,20);
                a2=a2+40;
            }
            a2=120-20*(6-row);
            b2=b2-30;
            System.out.println();
        }
        int a3=480;
        int b3=310;
        for(int row=5;row>1;row--){
            for(int column=5;column>=row;column--){
                g.setColor(Color.green);
                g.drawOval(a3,b3,20,20);
                g.fillOval(a3,b3,20,20);
                a3=a3+40;
            }
            a3=480-20*(6-row);
            b3=b3-30;
            System.out.println();
        }
        int a4=120;
        int b4=370;
        for(int row=1;row<5;row++){
            for(int column=1;column<=row;column++){
                g.setColor(Color.green);
                g.drawOval(a4,b4,20,20);
                g.fillOval(a4,b4,20,20);
                a4=a4+40;
            }
            a4=120-20*row;
            b4=b4+30;
            System.out.println();
        }
        int a5=480;
        int b5=370;
        for(int row=1;row<5;row++){
            for(int column=1;column<=row;column++){
                g.setColor(Color.yellow);
                g.drawOval(a5,b5,20,20);
                g.fillOval(a5,b5,20,20);
                a5=a5+40;
            }
            a5=480-20*row;
            b5=b5+30;
            System.out.println();
        }
    }
    public static void main(String[] args) {
        JumpChess a=new JumpChess();
        a.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}

